<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2D与3D</title>
    <style>
       /* 旋转rotate */
        .rotate{
            width: 200px;
            height: 200px;
            background-color: rgb(41, 166, 114);
            margin-left: 30px;
            margin-bottom: 10px;
            display: inline-block;
        }
        .rotate:hover{
            transform:rotate(20deg);
        }

        /* 拉伸skew */
        .skew{
            width: 200px;
            height: 200px;
            background-color: rgb(19, 119, 136);
            margin-left: 30px;
            margin-bottom: 10px;
            display: inline-block;
        }
        .skew:hover{
            transform: skew(20deg, 10deg);
        }

        /* 位移translate */
        .translate{
            width: 200px;
            height: 200px;
            background-color: rgb(132, 66, 125);
            margin-left: 30px;
            margin-bottom: 10px;
            display: inline-block;
        }
        .translate:hover{
            transform: translate(30px, 10px);
        }

        /* 缩放scale */
        .scale{
            width: 200px;
            height: 200px;
            background-color: rgb(182, 104, 104);
            margin-left: 30px;
            margin-bottom: 10px;
            display: inline-block;
        }
        .scale:hover{
            transform: scale(1.5,1.5);
        }
 /* .rotateX旋转 */
        .rotateX{
            width: 200px;
            height: 200px;
            background-color: rgb(215, 104, 160);
            margin: 20px;
            transition: all 2s;
              display: inline-block;
        }
        .rotateX:hover{
            transform: rotateX(150deg);
        }

        /* rotateY旋转 */
        .rotateY{
            width: 200px;
            height: 200px;
            background-color: rgb(160, 46, 55);
            margin: 20px;
            transition: all 2s;
              display: inline-block;
        }
        .rotateY:hover{
            transform: rotateY(130deg);
        }

        /* rotateZ旋转 */
        .rotateZ{
            width: 200px;
            height: 200px;
            background-color: rgb(205, 219, 55);
            margin: 20px;
            transition: all 2s;
              display: inline-block;
        }
        .rotateZ:hover{
            transform: rotateZ(90deg);
        }
    </style>
</head>
<body>
   <h2>2D</h2>
  <div>
    <div class="rotate">旋转</div>
    <div class="skew">拉伸</div>
    <div class="scale">缩放</div>
    <div  class="translate">位移</div>
  </div>
<h2>3D</h2>
<div>
    <div class="rotateX">X旋转</div>
    <div class="rotateY">Y旋转</div>
    <div class="rotateZ">Z旋转</div>
</div>
</body>
</html>